--
-- Author: ping.wang
-- Date: 2018-07-13 17:51:11
--

local AuctionNormalProductVo = import(".AuctionNormalProductVo")
local fileName = string.getModeName(...)
local ClassRef = class(fileName,AuctionNormalProductVo)

function ClassRef:ctor(data)
	if data then
		self.super.initWithData(self, data.goods)
		self:initWithData(data)
	end
end

function ClassRef:initWithData(data)
	self._biddingPrice = data.biddingPrice or 0--当前出价
	self._biddingStamp = data.biddingStamp --出价时间
	self._myBiddingPrice = data.myBiddingPrice or 0--我的出价
	self._fixedPrice = data.buyoutPrice --一口价
end

--获得当前出价
function ClassRef:getBidingPrice()
	if (not self._biddingPrice) or self._biddingPrice == 0 then
		return self:getSellPrice()
	else
		return self._biddingPrice
	end
end

--是否有人竞价
function ClassRef:hasBiding()
	return self._biddingPrice ~= 0
end

--获得我的出价
function ClassRef:getMyBiddingPrice()
	return self._myBiddingPrice
end

--获得我的出价时间 每个人出价有时间间隔
function ClassRef:getMyBidingStamp()
	return self._biddingStamp
end

--获得一口价
function ClassRef:getFixedPrice()
	return self._fixedPrice
end

--判断我是否是最高出价者
function ClassRef:isMeTheMaxBiddingPrice()
	if self._biddingPrice == 0 or self._myBiddingPrice == 0 then
		return false
	else
		return self._myBiddingPrice == self._biddingPrice
	end
end

return ClassRef